<!--
 * @Author: 周艳凯 484894717@qq.com
 * @Date: 2025-03-21 11:34:42
 * @LastEditors: 周艳凯 484894717@qq.com
 * @LastEditTime: 2025-03-30 21:27:40
 * @FilePath: \BusStopBoard.Webd:\360MoveData\Users\75041\Desktop\uniapp框架\my-project\src\pages\poput\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <view>
        <view>
            <!-- <button @click='morestps'>返回首页</button> -->
        </view>
        <view class="listCon">
            <view v-for="item in lineNode" :key="item.id" :class="['list', { active: item.id == activeInfo.id }]"
                @click="ChannelMergerNode(item)">
                {{ item.name }}
            </view>
        </view>
        <view v-if="activeInfo && activeInfo.id">
            <lines :items="activeInfo"></lines>
        </view>
    </view>
</template>

<script>
import { getnodelistbydevsn } from '@/api/common/user/user';
import lines from '@/pages/index/line.vue';

export default {
    data() {
        return {
            lineNode: [],
            activeInfo: {
                id:''
            },
        };
    },
    components: {
        lines,
    },
    mounted() {
        getnodelistbydevsn({
            DevSN: this.$store.state.androidId,
        }).then((res) => {
            this.lineNode = res.data.result;
        });
    },
    methods: {
        ChannelMergerNode(params) {
            this.activeInfo = params;
        },
        // morestps: function () {
		// 	uni.navigateTo({
		// 		url: '/pages/index/index',
		// 	});
		// },
    },
};
</script>

<style lang="scss" scoped>
.footer {
    padding: 12px;
}

.listCon {
    display: flex;
    flex-wrap: wrap;
}

.listCon .list {
    display: inline-flex;
    padding: 10rpx;
    margin: 10rpx;
    font-size: 20rpx;
    background: rgb(15, 164, 239);
    border-radius: 12rpx;
}

.listCon .active {
    color: #fff;
    background-color: coral;
}
</style>